package com.yang.concurrency.chapter5;

import com.yang.concurrency.chapter7.ThreadService;

/**
 * @Author: 血魔
 * @Date: Created in 16:50 2021/12/12
 * @Version: $
 */
public class ThreadCloseForce {
    public static void main(String[] args) {
        ThreadService service = new ThreadService();
        long start = System.currentTimeMillis();
        service.execute( ()-> {
            while (true);
        });

        service.shutdown(1000);
        long end = System.currentTimeMillis();
        System.out.println("执行时间：" + (end - start));
    }
}
